home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Miami / MiamiSDK / doc / UserGroup.doc < prev   
Text File  |  1997-12-23  |  23KB  |  1,024 lines

  1. TABLE OF CONTENTS
  2.  
  3. usergroup.library/crypt
  4. usergroup.library/endgrent
  5. usergroup.library/endpwent
  6. usergroup.library/endutent
  7. usergroup.library/getcredentials
  8. usergroup.library/getegid
  9. usergroup.library/geteuid
  10. usergroup.library/getgid
  11. usergroup.library/getgrent
  12. usergroup.library/getgrgid
  13. usergroup.library/getgrnam
  14. usergroup.library/getgroups
  15. usergroup.library/getlastlog
  16. usergroup.library/getlogin
  17. usergroup.library/getpass
  18. usergroup.library/getpgrp
  19. usergroup.library/getpwent
  20. usergroup.library/getpwnam
  21. usergroup.library/getpwuid
  22. usergroup.library/getuid
  23. usergroup.library/getumask
  24. usergroup.library/getutent
  25. usergroup.library/initgroups
  26. usergroup.library/setgid
  27. usergroup.library/setgrent
  28. usergroup.library/setgroups
  29. usergroup.library/setlastlog
  30. usergroup.library/setlogin
  31. usergroup.library/setpwent
  32. usergroup.library/setregid
  33. usergroup.library/setreuid
  34. usergroup.library/setsid
  35. usergroup.library/setuid
  36. usergroup.library/setutent
  37. usergroup.library/ug_GetErr
  38. usergroup.library/ug_GetSalt
  39. usergroup.library/ug_SetupContextTagList
  40. usergroup.library/ug_StrError
  41. usergroup.library/umask
  42. usergroup.library/crypt                   usergroup.library/crypt
  43.  
  44.    NAME
  45.     crypt -- password encryption
  46.  
  47.    SYNOPSIS
  48.     res = crypt( key, set );
  49.     D0         A0   A1
  50.  
  51.     char *crypt( const char *key, const char *set );
  52.  
  53.    FUNCTION
  54.     The crypt function performs password encryption.  The algorithm used
  55.     for encryption is implementation-dependent.
  56.  
  57.     The first argument to crypt is a NUL-terminated string (normally a
  58.     password typed by a user).  The second is a character array, 9 bytes
  59.     in length, consisting of an underscore (``_'') followed by 4 bytes of
  60.     iteration count and 4 bytes of salt.  Both the iteration count and
  61.     the salt are encoded with 6 bits per character, least significant
  62.     bits first.  The values 0 to 63 are encoded by the characters
  63.     ``./0-9A-Za-z'', respectively.
  64.  
  65.     The salt is used to induce disorder into the encryption algorithm in
  66.     one of 16777216 possible ways.    The value returned is a
  67.     NUL-terminated string, 20 bytes in length, consisting of the setting
  68.     followed by the encoded 64-bit encryption.
  69.  
  70.     The function crypt() returns a pointer to the encrypted value on
  71.     success and NULL on failure.
  72.  
  73.    INPUTS
  74.     key - password
  75.  
  76.     set - setting
  77.  
  78.    RESULT
  79.     res (D0) - result
  80.  
  81. usergroup.library/endgrent               usergroup.library/endgrent
  82.  
  83.    NAME
  84.     endgrent -- group database operations
  85.  
  86.    SYNOPSIS
  87.     endgrent();
  88.  
  89.  
  90.     void endgrent (void);
  91.  
  92.    FUNCTION
  93.     The function endgrent() releases any resources allocated by
  94.     setgrent().
  95.  
  96.     This function has been deprecated.
  97.  
  98. usergroup.library/endpwent               usergroup.library/endpwent
  99.  
  100.    NAME
  101.     endpwent -- password database operations
  102.  
  103.    SYNOPSIS
  104.     endpwent();
  105.  
  106.  
  107.     void endpwent (void);
  108.  
  109.    FUNCTION
  110.     The function endpwent() releases any resources allocated by
  111.     setpwent().
  112.  
  113.     This function has been deprecated.
  114.  
  115. usergroup.library/endutent               usergroup.library/endutent
  116.  
  117.    NAME
  118.     endutent -- utmp database operations
  119.  
  120.    SYNOPSIS
  121.     endutent();
  122.  
  123.  
  124.     void endutent (void);
  125.  
  126.    FUNCTION
  127.     The function endutent() releases any resources allocated by
  128.     setutent().
  129.  
  130.     This function has been deprecated.
  131.  
  132. usergroup.library/getcredentials         usergroup.library/getcredentials
  133.  
  134.    NAME
  135.     getcredentials -- get the credentials of the specified task
  136.  
  137.    SYNOPSIS
  138.     cred = getcredentials( task );
  139.     D0               A0
  140.  
  141.     struct UserGroupCredentials *getcredentials( struct Task *task );
  142.  
  143.    FUNCTION
  144.     Return the credentials of the specified exec task.
  145.  
  146.     This function has been deprecated.
  147.  
  148.    INPUTS
  149.     task - task
  150.  
  151.    RESULT
  152.     cred (D0) - credentials
  153.  
  154. usergroup.library/getegid                usergroup.library/getegid
  155.  
  156.    NAME
  157.     getegid -- get group process identification
  158.  
  159.    SYNOPSIS
  160.     id = getegid();
  161.     D0
  162.  
  163.     uid_t getegid (void);
  164.  
  165.    FUNCTION
  166.     The getegid() function returns the effective group ID of the calling
  167.     process.
  168.  
  169.     The real group ID is the group of the user who invoked the program.
  170.     The effective group ID gives the process additional permissions
  171.     during the execution of ``set-group-ID'' mode processes.
  172.  
  173.    RESULT
  174.     id (D0) - group id
  175.  
  176. usergroup.library/geteuid                usergroup.library/geteuid
  177.  
  178.    NAME
  179.     geteuid -- get user identification
  180.  
  181.    SYNOPSIS
  182.     id = geteuid();
  183.     D0
  184.  
  185.     uid_t geteuid (void);
  186.  
  187.    FUNCTION
  188.     The getuid() function returns the effective user ID of the calling
  189.     process.
  190.  
  191.    RESULT
  192.     id (D0) - user id
  193.  
  194. usergroup.library/getgid                 usergroup.library/getgid
  195.  
  196.    NAME
  197.     getgid -- get group process identification
  198.  
  199.    SYNOPSIS
  200.     id = getgid();
  201.     D0
  202.  
  203.     uid_t getgid (void);
  204.  
  205.    FUNCTION
  206.     The getgid() function returns the real group ID of the calling
  207.     process.
  208.  
  209.     The real group ID is specified at login time.
  210.  
  211.     The real group ID is the group of the user who invoked the program.
  212.     As the effective group ID gives the process additional permissions
  213.     during the execution of ``set-group-ID'' mode processes, getgid() is
  214.     used to determine the real-user-id of the calling process.
  215.  
  216.    RESULT
  217.     id (D0) - group id
  218.  
  219. usergroup.library/getgrent               usergroup.library/getgrent
  220.  
  221.    NAME
  222.     getgrent -- group database operations
  223.  
  224.    SYNOPSIS
  225.     grp = getgrent();
  226.     D0
  227.  
  228.     struct group *getgrent (void);
  229.  
  230.    FUNCTION
  231.     The function getgrent() sequentially reads the group database.
  232.  
  233.     The functions getgrent() returns a valid pointer to a group structure
  234.     on success and a null pointer if the end of the database is reached
  235.     or an error occurs.
  236.  
  237.     This function has been deprecated.
  238.  
  239.    RESULT
  240.     grp (D0) - group entry
  241.  
  242. usergroup.library/getgrgid               usergroup.library/getgrgid
  243.  
  244.    NAME
  245.     getgrgid -- group database operations
  246.  
  247.    SYNOPSIS
  248.     grp = getgrgid( gid );
  249.     D0        D0
  250.  
  251.     struct group *getgrgid( gid_t gid );
  252.  
  253.    FUNCTION
  254.     The function getgrgid() searches the group database for the given
  255.     group id, always returning the first one encountered.  The function
  256.     getgrgid() returns a valid pointer to a group structure on success
  257.     and a null pointer if no matching entry is found.
  258.  
  259.    INPUTS
  260.     gid - group id
  261.  
  262.    RESULT
  263.     grp (D0) - group entry
  264.  
  265. usergroup.library/getgrnam               usergroup.library/getgrnam
  266.  
  267.    NAME
  268.     getgrnam -- group database operations
  269.  
  270.    SYNOPSIS
  271.     grp = getgrnam( name );
  272.     D0        A1
  273.  
  274.     struct group *getgrnam( char *name );
  275.  
  276.    FUNCTION
  277.     The function getgrnam() searches the group database for the given
  278.     group name, always returning the first one encountered.  The function
  279.     getgrnam() returns a valid pointer to a group structure on success
  280.     and a null pointer if no matching entry is found.
  281.  
  282.    INPUTS
  283.     name - group name
  284.  
  285.    RESULT
  286.     grp (D0) - group entry
  287.  
  288. usergroup.library/getgroups              usergroup.library/getgroups
  289.  
  290.    NAME
  291.     getgroups -- get group access list
  292.  
  293.    SYNOPSIS
  294.     ret = getgroups( gidsetlen, gidset );
  295.     D0         D0        A1
  296.  
  297.     int getgroups( int gidsetlen, gid_t *gidset );
  298.  
  299.    FUNCTION
  300.     getgroups() gets the current group access list of the user process
  301.     and stores it in the array gidset.  The parameter gidsetlen indicates
  302.     the number of entries that may be placed in gidset.  getgroups()
  303.     returns the actual number of groups returned in gidset.  No more than
  304.     NGROUPS, as defined in <sys/param.h>, will ever be returned.
  305.  
  306.     A successful call returns the number of groups in the group set.  A
  307.     value of -1 indicates that an error occurred, and the error code is
  308.     stored in the global variable errno.
  309.  
  310.     The possible errors for getgroups() are:
  311.  
  312.     [EINVAL] The argument gidsetlen is smaller than the number of groups
  313.     in the group set.
  314.  
  315.    INPUTS
  316.     gidsetlen - gid set len
  317.  
  318.     gidset - gid set
  319.  
  320.    RESULT
  321.     ret (D0) - return code
  322.  
  323. usergroup.library/getlastlog             usergroup.library/getlastlog
  324.  
  325.    NAME
  326.     getlastlog -- get lastlog entry
  327.  
  328.    SYNOPSIS
  329.     lastlog = getlastlog( uid );
  330.     D0              D0
  331.  
  332.     struct lastlog *getlastlog( uid_t uid );
  333.  
  334.    FUNCTION
  335.     Return the entry corresponding to the last login for the specified
  336.     user.
  337.  
  338.     This function has been deprecated.
  339.  
  340.    INPUTS
  341.     uid - user id
  342.  
  343.    RESULT
  344.     lastlog (D0) - last login entry
  345.  
  346. usergroup.library/getlogin               usergroup.library/getlogin
  347.  
  348.    NAME
  349.     getlogin -- get login name
  350.  
  351.    SYNOPSIS
  352.     login = getlogin();
  353.     D0
  354.  
  355.     char *getlogin (void);
  356.  
  357.    FUNCTION
  358.     The getlogin() routine returns the login name of the user associated
  359.     with the current session, as previously set by setlogin().
  360.  
  361.     If a call to getlogin() succeeds, it returns a pointer to a
  362.     null-terminated string in a static buffer.  If the name has not been
  363.     set, it returns NULL.
  364.  
  365.    RESULT
  366.     login (D0) - login name
  367.  
  368. usergroup.library/getpass                usergroup.library/getpass
  369.  
  370.    NAME
  371.     getpass -- get a password
  372.  
  373.    SYNOPSIS
  374.     pwd = getpass( prompt );
  375.     D0           A0
  376.  
  377.     char *getpass( const char *prompt );
  378.  
  379.    FUNCTION
  380.     The getpass() function displays a prompt and reads in a password in
  381.     an implementation-dependent way.
  382.  
  383.     The password may be up to _PASSWORD_LEN (currently 128) characters in
  384.     length.  Any additional characters and the terminating newline
  385.     character are discarded.
  386.  
  387.     getpass() returns a pointer to the null terminated password.
  388.  
  389.    INPUTS
  390.     prompt - prompt
  391.  
  392.    RESULT
  393.     pwd (D0) - password
  394.  
  395. usergroup.library/getpgrp                usergroup.library/getpgrp
  396.  
  397.    NAME
  398.     getpgrp -- get process group
  399.  
  400.    SYNOPSIS
  401.     process = getpgrp();
  402.     D0
  403.  
  404.     pid_t *getpgrp (void);
  405.  
  406.    FUNCTION
  407.     The process group of the current process is returned by getpgrp().
  408.  
  409.     This function has been deprecated.
  410.  
  411.    RESULT
  412.     process (D0) - process id
  413.  
  414. usergroup.library/getpwent               usergroup.library/getpwent
  415.  
  416.    NAME
  417.     getpwent -- password database operations
  418.  
  419.    SYNOPSIS
  420.     pwd = getpwent();
  421.     D0
  422.  
  423.     struct passwd *getpwent (void);
  424.  
  425.    FUNCTION
  426.     The function getpwent() sequentially reads the user database.
  427.  
  428.     The functions getpwent() returns a valid pointer to a passwd
  429.     structure on success and a null pointer if the end of the database is
  430.     reached or an error occurs.
  431.  
  432.     This function has been deprecated.
  433.  
  434.    RESULT
  435.     pwd (D0) - password entry
  436.  
  437. usergroup.library/getpwnam               usergroup.library/getpwnam
  438.  
  439.    NAME
  440.     getpwnam -- password database operations
  441.  
  442.    SYNOPSIS
  443.     pwd = getpwnam( login );
  444.     D0        A1
  445.  
  446.     struct passwd *getpwnam( char *login );
  447.  
  448.    FUNCTION
  449.     The function getpwnam() searches the password database for the given
  450.     login name, always returning the first one encountered.  The function
  451.     getpwnam() returns a valid pointer to a passwd structure on success
  452.     and a null pointer if no matching entry is found.
  453.  
  454.    INPUTS
  455.     login - login name
  456.  
  457.    RESULT
  458.     pwd (D0) - password entry
  459.  
  460. usergroup.library/getpwuid               usergroup.library/getpwuid
  461.  
  462.    NAME
  463.     getpwuid -- password database operations
  464.  
  465.    SYNOPSIS
  466.     pwd = getpwuid( uid );
  467.     D0        d0
  468.  
  469.     struct passwd *getpwuid( uid_t *uid );
  470.  
  471.    FUNCTION
  472.     The function getpwuid() searches the password database for the given
  473.     user uid, always returning the first one encountered.  The function
  474.     getpwuid() returns a valid pointer to a passwd structure on success
  475.     and a null pointer if no matching entry is found.
  476.  
  477.    INPUTS
  478.     uid - user id
  479.  
  480.    RESULT
  481.     pwd (D0) - password entry
  482.  
  483. usergroup.library/getuid                 usergroup.library/getuid
  484.  
  485.    NAME
  486.     getuid -- get user identification
  487.  
  488.    SYNOPSIS
  489.     id = getuid();
  490.     D0
  491.  
  492.     uid_t getuid (void);
  493.  
  494.    FUNCTION
  495.     The getuid() function returns the real user ID of the calling
  496.     process.
  497.  
  498.    RESULT
  499.     id (D0) - user id
  500.  
  501. usergroup.library/getumask               usergroup.library/getumask
  502.  
  503.    NAME
  504.     getumask -- set file creation mode mask
  505.  
  506.    SYNOPSIS
  507.     ret = getumask();
  508.     D0
  509.  
  510.     mode_t getumask (void);
  511.  
  512.    FUNCTION
  513.     Return the current file creation mask.
  514.  
  515.    RESULT
  516.     ret (D0) - old mask
  517.  
  518. usergroup.library/getutent               usergroup.library/getutent
  519.  
  520.    NAME
  521.     getutent -- utmp database operations
  522.  
  523.    SYNOPSIS
  524.     ent = getutent();
  525.     D0
  526.  
  527.     struct utmp *getutent (void);
  528.  
  529.    FUNCTION
  530.     The function getutent() sequentially reads the utmp database.
  531.  
  532.     The functions getutent() returns a valid pointer to a utmp structure
  533.     on success and a null pointer if the end of the database is reached
  534.     or an error occurs.
  535.  
  536.     This function has been deprecated.
  537.  
  538.    RESULT
  539.     ent (D0) - utmp entry
  540.  
  541. usergroup.library/initgroups             usergroup.library/initgroups
  542.  
  543.    NAME
  544.     initgroups -- initialize group access list
  545.  
  546.    SYNOPSIS
  547.     ret = initgroups( name, basegid );
  548.     D0          A1    D0
  549.  
  550.     int initgroups( char *name, int basegid );
  551.  
  552.    FUNCTION
  553.     The initgroups() function calculates the group access list for the
  554.     user specified in name.  This group list is then setup for the
  555.     current process using setgroups().  The basegid is automatically
  556.     included in the groups list.  Typically this value is given as the
  557.     group number from the password file.
  558.  
  559.     The initgroups() function returns -1 if it was not invoked by the
  560.     super-user.
  561.  
  562.    INPUTS
  563.     name - user name
  564.  
  565.     basegid - base gid
  566.  
  567.    RESULT
  568.     ret (D0) - return code
  569.  
  570. usergroup.library/setgid                 usergroup.library/setgid
  571.  
  572.    NAME
  573.     setgid -- set group ID
  574.  
  575.    SYNOPSIS
  576.     ret = setgid( rgid, egid );
  577.     D0          D0    D1
  578.  
  579.     int setgid( gid_t rgid, gid_t egid );
  580.  
  581.    FUNCTION
  582.     The setgid() function sets the real and effective group IDs and the
  583.     saved set-group-ID of the current process to the specified value.
  584.     The setgid() function is permitted if the specified ID is equal to
  585.     the real group ID of the process, or if the effective user ID is that
  586.     of the super user.
  587.  
  588.     Upon success, the function returns 0; otherwise -1 is returned.
  589.  
  590.     If the user is not the super user, or the uid specified is not the
  591.     real, effective ID, or saved ID, these functions return -1.
  592.  
  593.    INPUTS
  594.     rgid - real group id
  595.  
  596.     egid - effective group id
  597.  
  598.    RESULT
  599.     ret (D0) - return code
  600.  
  601. usergroup.library/setgrent               usergroup.library/setgrent
  602.  
  603.    NAME
  604.     setgrent -- group database operations
  605.  
  606.    SYNOPSIS
  607.     ret = setgrent();
  608.     D0
  609.  
  610.     int setgrent (void);
  611.  
  612.    FUNCTION
  613.     The function setgrent() rewinds the group database.
  614.  
  615.     The function setgrent() returns 0 on failure and 1 on success.
  616.  
  617.     This function has been deprecated.
  618.  
  619.    RESULT
  620.     ret (D0) - return code
  621.  
  622. usergroup.library/setgroups              usergroup.library/setgroups
  623.  
  624.    NAME
  625.     setgroups -- set group access list
  626.  
  627.    SYNOPSIS
  628.     ret = setgroups( gidsetlen, gidset );
  629.     D0         D0        A1
  630.  
  631.     int setgroups( int gidsetlen, gid_t *gidset );
  632.  
  633.    FUNCTION
  634.     setgroups() sets the group access list of the current user process
  635.     according to the array gidset.    The parameter ngroups indicates the
  636.     number of entries in the array and must be no more than NGROUPS, as
  637.     defined in <sys/param.h>.
  638.  
  639.     Only the super-user may set new groups.
  640.  
  641.     A 0 value is returned on success, -1 on error, with an error code
  642.     stored in errno.
  643.  
  644.     The setgroups() call will fail if:
  645.  
  646.     [EPERM] The caller is not the super-user.
  647.  
  648.    INPUTS
  649.     gidsetlen - gid set len
  650.  
  651.     gidset - gid set
  652.  
  653.    RESULT
  654.     ret (D0) - return code
  655.  
  656. usergroup.library/setlastlog             usergroup.library/setlastlog
  657.  
  658.    NAME
  659.     setlastlog -- set lastlog entry
  660.  
  661.    SYNOPSIS
  662.     lastlog = setlastlog( uid, name, host );
  663.     D0              D0   A0     A1
  664.  
  665.     struct lastlog *setlastlog( uid_t uid, char *name, char *host );
  666.  
  667.    FUNCTION
  668.     Set the login entry for the specified user.
  669.  
  670.     This function has been deprecated.
  671.  
  672.    INPUTS
  673.     uid - user id
  674.  
  675.     name - name
  676.  
  677.     host - host
  678.  
  679.    RESULT
  680.     lastlog (D0) - last login entry
  681.  
  682. usergroup.library/setlogin               usergroup.library/setlogin
  683.  
  684.    NAME
  685.     setlogin -- set login name
  686.  
  687.    SYNOPSIS
  688.     login = setlogin();
  689.     A1
  690.  
  691.     char *setlogin (void);
  692.  
  693.    FUNCTION
  694.     setlogin() sets the login name of the user associated with the
  695.     current session to name.  This call is restricted to the super-user,
  696.     and is normally used only when a new session is being created on
  697.     behalf of the named user (for example, at login time, or when a
  698.     remote shell is invoked).
  699.  
  700.     If a call to setlogin() succeeds, a value of 0 is returned.  If
  701.     setlogin() fails, a value of -1 is returned and an error code is
  702.     placed in the global location errno.
  703.  
  704.     The following errors may be returned by these calls:
  705.  
  706.     [EINVAL] The name parameter pointed to a string that was too long.
  707.     Login names are limited to MAXLOGNAME (from <sys/param.h>)
  708.     characters, currently 12.
  709.  
  710.     [EPERM] The caller tried to set the login name and was not the
  711.     super-user.
  712.  
  713.    RESULT
  714.     login (A1) - login name
  715.  
  716. usergroup.library/setpwent               usergroup.library/setpwent
  717.  
  718.    NAME
  719.     setpwent -- password database operations
  720.  
  721.    SYNOPSIS
  722.     ret = setpwent();
  723.     D0
  724.  
  725.     int setpwent (void);
  726.  
  727.    FUNCTION
  728.     The function setpwent() rewinds the password database.
  729.  
  730.     The function setpwent() returns 0 on failure and 1 on success.
  731.  
  732.     This function has been deprecated.
  733.  
  734.    RESULT
  735.     ret (D0) - return code
  736.  
  737. usergroup.library/setregid               usergroup.library/setregid
  738.  
  739.    NAME
  740.     setregid -- set real and effective group ID
  741.  
  742.    SYNOPSIS
  743.     ret = setregid( rgid, egid );
  744.     D0        D0    D1
  745.  
  746.     int setregid( gid_t rgid, gid_t egid );
  747.  
  748.    FUNCTION
  749.     The real and effective group ID's of the current process are set to
  750.     the arguments.    Unprivileged users may change the real group ID to
  751.     the effective group ID and vice-versa; only the super-user may make
  752.     other changes.
  753.  
  754.     Supplying a value of -1 for either the real or effective group ID
  755.     forces the system to substitute the current ID in place of the -1
  756.     parameter.
  757.  
  758.     When setting the real and effective group IDs to the same value, the
  759.     standard setgid() function is preferred.
  760.  
  761.     Upon success, the function returns 0; otherwise -1 is returned.
  762.  
  763.     If the user is not the super user, or the uid specified is not the
  764.     real, effective ID, or saved ID, these functions return -1.
  765.  
  766.    INPUTS
  767.     rgid - real group id
  768.  
  769.     egid - effective group id
  770.  
  771.    RESULT
  772.     ret (D0) - return code
  773.  
  774. usergroup.library/setreuid               usergroup.library/setreuid
  775.  
  776.    NAME
  777.     setreuid -- set real and effective user IDs
  778.  
  779.    SYNOPSIS
  780.     ret = setreuid( ruid, euid );
  781.     D0        D0    D1
  782.  
  783.     int setreuid( uid_t ruid, uid_t euid );
  784.  
  785.    FUNCTION
  786.     The real and effective user IDs of the current process are set
  787.     according to the arguments.  If ruid or euid is -1, the current uid
  788.     is filled in by the system.  Unprivileged users may change the real
  789.     user ID to the effective user ID and vice-versa; only the super-user
  790.     may make other changes.
  791.  
  792.     When setting the real and effective user IDs to the same value, the
  793.     standard setuid() function is preferred.
  794.  
  795.     Upon successful completion, a value of 0 is returned.  Otherwise, a
  796.     value of -1 is returned and errno is set to indicate the error.
  797.  
  798.     Possible errors:
  799.  
  800.     [EPERM] The current process is not the super-user and a change other
  801.     than changing the effective user-id to the real user-id was
  802.     specified.
  803.  
  804.    INPUTS
  805.     ruid - real user id
  806.  
  807.     euid - effective user id
  808.  
  809.    RESULT
  810.     ret (D0) - return code
  811.  
  812. usergroup.library/setsid                 usergroup.library/setsid
  813.  
  814.    NAME
  815.     setsid -- create session and set process group ID
  816.  
  817.    SYNOPSIS
  818.     process = setsid();
  819.     D0
  820.  
  821.     pid_t *setsid (void);
  822.  
  823.    FUNCTION
  824.     The setsid function creates a new session.  The calling process is
  825.     the session leader of the new session, is the process group leader of
  826.     a new process group and has no controlling terminal.  The calling
  827.     process is the only process in either the session or the process
  828.     group.
  829.  
  830.     Upon successful completion, the setsid function returns the value of
  831.     the process group ID of the new process group, which is the same as
  832.     the process ID of the calling process.
  833.  
  834.     If an error occurs, setsid returns -1 and the global variable errno
  835.     is set to indicate the error, as follows:
  836.  
  837.     [EPERM] The calling process is already a process group leader, or the
  838.     process group ID of a process other than the calling process matches
  839.     the process ID of the calling process.
  840.  
  841.    RESULT
  842.     process (D0) - process id
  843.  
  844. usergroup.library/setuid                 usergroup.library/setuid
  845.  
  846.    NAME
  847.     setuid -- set user id
  848.  
  849.    SYNOPSIS
  850.     ret = setuid( uid );
  851.     D0          D0
  852.  
  853.     int setuid( uid_t uid );
  854.  
  855.    FUNCTION
  856.     The setuid() function sets the real and effective user IDs and the
  857.     saved set-user-ID of the current process to the specified value.  The
  858.     setuid() function is permitted if the specified ID is equal to the
  859.     real user ID of the process, or if the effective user ID is that of
  860.     the super user.
  861.  
  862.     Upon success, the function returns 0; otherwise -1 is returned.
  863.  
  864.     If the user is not the super user, or the uid specified is not the
  865.     real, effective ID, or saved ID, these functions return -1.
  866.  
  867.    INPUTS
  868.     uid - user id
  869.  
  870.    RESULT
  871.     ret (D0) - return code
  872.  
  873. usergroup.library/setutent               usergroup.library/setutent
  874.  
  875.    NAME
  876.     setutent -- utmp database operations
  877.  
  878.    SYNOPSIS
  879.     setutent();
  880.  
  881.  
  882.     void setutent (void);
  883.  
  884.    FUNCTION
  885.     Rewind the utmp database
  886.  
  887.     This function has been deprecated.
  888.  
  889. usergroup.library/ug_GetErr              usergroup.library/ug_GetErr
  890.  
  891.    NAME
  892.     ug_GetErr -- ret current error code
  893.  
  894.    SYNOPSIS
  895.     ret = ug_GetErr();
  896.     D0
  897.  
  898.     int ug_GetErr (void);
  899.  
  900.    FUNCTION
  901.     Get the current error code (the value of the errno variable).
  902.  
  903.    RESULT
  904.     ret (D0) - error
  905.  
  906. usergroup.library/ug_GetSalt             usergroup.library/ug_GetSalt
  907.  
  908.    NAME
  909.     ug_GetSalt -- generate settings for password encryption
  910.  
  911.    SYNOPSIS
  912.     res = ug_GetSalt( user, buf, size );
  913.     D0          A0    A1   D0
  914.  
  915.     char *ug_GetSalt( char *user, char *buf, unsigned long size );
  916.  
  917.    FUNCTION
  918.     ug_GetSalt() creates a text string that is suitable to be passed to
  919.     the crypt() function as a settings string.
  920.  
  921.    INPUTS
  922.     user - user
  923.  
  924.     buf - buffer
  925.  
  926.     size - size
  927.  
  928.    RESULT
  929.     res (D0) - salt
  930.  
  931. usergroup.library/ug_SetupContextTagList
  932.  
  933.    NAME
  934.     ug_SetupContextTagList -- set up process context
  935.     ug_SetupContextTags -- Varargs stub for ug_SetupContextTagList().
  936.  
  937.    SYNOPSIS
  938.     ret = ug_SetupContextTagList( name, tags );
  939.     D0                  A0    A1
  940.  
  941.     int ug_SetupContextTagList( char *name, struct TagItem *tags );
  942.  
  943.     ret = ug_SetupContextTags( name, name, ... );
  944.  
  945.     int ug_SetupContextTags( char *name, char name, ... );
  946.  
  947.    FUNCTION
  948.     ug_SetupContextTagList() and its varargs-equivalent,
  949.     ug_SetUpContextTags(), have the purpose of setting up some context
  950.     information for the calling process and changing default settings.
  951.  
  952.     The first parameter is the program name, the second parameter is a
  953.     TagList.  Currently the following TagItems are valid:
  954.  
  955.     UGT_ERRNOPTR: link the process's errno variable to the errno variable
  956.     of usergroup.library (by passing a pointer to the process's errno
  957.     variable to usergroup.library).
  958.  
  959.     UGT_ERRNOSIZE: specify the size of the process's errno variable.
  960.     Valid values are 1, 2 or 4.
  961.  
  962.     UGT_INTRMASK: specify the interrupt signal mask.  This TagItem
  963.     currently has no effect.
  964.  
  965.     UGT_OWNER: changes the owner of the current library instance.  You
  966.     should not normally need to use this tag.  It is indented for unusual
  967.     versions of startup code only.
  968.  
  969.     The return code is 0 for success and -1 for failure.
  970.  
  971.    INPUTS
  972.     name - program name
  973.  
  974.     tags - taglist
  975.  
  976.    RESULT
  977.     ret (D0) - return code
  978.  
  979. usergroup.library/ug_StrError            usergroup.library/ug_StrError
  980.  
  981.    NAME
  982.     ug_StrError -- convert an error code into a text string
  983.  
  984.    SYNOPSIS
  985.     ret = ug_StrError( err );
  986.     D0           D1
  987.  
  988.     char *ug_StrError( int err );
  989.  
  990.    FUNCTION
  991.     Return the text string associated with an error code.
  992.  
  993.    INPUTS
  994.     err - error code
  995.  
  996.    RESULT
  997.     ret (D0) - error string
  998.  
  999. usergroup.library/umask                   usergroup.library/umask
  1000.  
  1001.    NAME
  1002.     umask -- set file creation mode mask
  1003.  
  1004.    SYNOPSIS
  1005.     ret = umask( numask );
  1006.     D0         D0
  1007.  
  1008.     mode_t umask( mode_t numask );
  1009.  
  1010.    FUNCTION
  1011.     The umask() routine sets the process's file mode creation mask to
  1012.     numask and returns the previous value of the mask.
  1013.  
  1014.     The default mask value is 022.
  1015.  
  1016.     The previous value of the file mode mask is returned by the call.
  1017.  
  1018.    INPUTS
  1019.     numask - new mask
  1020.  
  1021.    RESULT
  1022.     ret (D0) - old mask
  1023.  
  1024.